<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<%@page import="util.PreHandle,pojo.Student"%>
<%@page import="java.sql.SQLException"%>
<%@ page language="java" import="java.util.*,pojo.examresult"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'Welcome.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>

<body>
	<%@include file="verify.jsp"%>
	<%
		out.print("欢迎" + session.getAttribute("name") + "登录");

		Integer st_id = (Integer) session.getAttribute("st_id");

		String sql = "select * from examresult where st_id=?";
		Connection con = PreHandle.getConnection();
		PreparedStatement pstmt = null;
		ResultSet res = null;
		pstmt = con.prepareStatement(sql);
		pstmt.setInt(1, st_id);
		res = pstmt.executeQuery();
		List<examresult> list = new ArrayList<examresult>();
		while (res.next()) {
			list.add(new examresult(res.getInt("id"), res.getInt("st_id"), res.getInt("sb_id"),
					res.getString("exam_date"), res.getFloat("score")));
		}
		PreHandle.closeAll(res, pstmt, con);
	%>
	<br />
	<%
		for (examresult ex : list) {
			out.print(ex);
		}
	%>
	<%@include file="copy.jsp"%>
</body>
</html>
